package j20251125;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Demo2 {
    public static void main(String[] args) {
        List<Person> people = new ArrayList<>();
        List<String> adultNames = new ArrayList<>();
        for (Person person : people) {
            if (person.getAge() > 18) {
                adultNames.add(person.getName());
            }
        }
        Collections.sort(adultNames);
    }
}
